Description: |
A combobox should allow an additional argument to specify a list of internal values in addition to the current list of display values.
Separation of display and internal values would make the use of localized text in comboboxes much easier to implement.
e.g.
set val yes
::msgcat::mclocale de
ttk::combobox -values [list [::msgcat::mc yes] [::msgcat::mc no]] \
-readonly -returnvalues [list yes no] -textvariable val
If -returnvalues is set, the current value in -textvariable should map to the display value in -values.
Likewise upon return, the selected display value should map to the return value in
-returnvalues and set -textvariable appropriately.
Even when there is no need for localization, this is a very common use case.
-returnvalues specified without -readonly is an error.
[llength -values] != [llength -returnvalues] is an error.
|
User Comments: |
anonymous (claiming to be [email protected]) added on 2016-02-14 15:50:22:
After looking at the way combobox is written, this would be too difficult to implement as combobox is highly dependent on its entry box child.
This is better implemented as a new widget as a wrapper around the combobox.
http://wiki.tcl.tk/41688 (part 2) has an implementation, not as a new widget but as a set of routines.
|